#ifndef MYSHAPE_H
#define MYSHAPE_H

#include "MyGraphic.h"
#include "MyFunction.h"
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;

class MyShape
{
private:
	MyGraphic* _myGraphic;
	

protected:
	MyGraphic* GetMyGraphic() {
		return _myGraphic;
	}
	
public:
	
	//Virtual methods
	virtual void Draw() = 0;
	virtual string ToString() = 0;
	virtual string GetName() = 0;
	//Static method(s)
	static vector<MyShape*> Parse(string filename);
	static bool Save(vector<MyShape*> shapes, string filename) {
		ofstream outputFile(filename);
		outputFile << "<svg xmlns=\"http://www.w3.org/2000/svg\">" << endl;
		for(unsigned int i = 0; i < shapes.size(); i++) {
			outputFile << shapes[i]->ToString() << endl;
		}
		outputFile << "</svg>";
		outputFile.close();
		return true;
	}
	
	void SetMyGraphic(MyGraphic* myGraphic) {
		_myGraphic = myGraphic;
	}
	//Destructor
	virtual ~MyShape() {
		//delete _myGraphic;
	}
};
#endif